<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><meta name="viewport" content="width=device-width, initial-scale=0.8"/><title>16.2.5&nbsp;编译和运行时阶段</title><link rel="stylesheet" type="text/css" href="scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="racket.css" title="default"/><link rel="stylesheet" type="text/css" href="manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="manual-racket.css" title="default"/><script type="text/javascript" src="scribble-common.js"></script><script type="text/javascript" src="manual-racket.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="scribble-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,&quot;tocview_0&quot;);">&#9658;</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x">Racket&#25351;&#21335;</a></td></tr></table></div><div class="tocviewsublisttop" style="display: none;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1&nbsp;</td><td><a href="intro.html" class="tocviewlink" data-pltdoc="x">&#27426;&#36814;&#26469;&#21040;Racket!</a></td></tr><tr><td align="right">2&nbsp;</td><td><a href="to-scheme.html" class="tocviewlink" data-pltdoc="x">Racket&#27010;&#35201;</a></td></tr><tr><td align="right">3&nbsp;</td><td><a href="datatypes.html" class="tocviewlink" data-pltdoc="x">&#20869;&#32622;&#30340;&#25968;&#25454;&#31867;&#22411;</a></td></tr><tr><td align="right">4&nbsp;</td><td><a href="scheme-forms.html" class="tocviewlink" data-pltdoc="x">&#34920;&#36798;&#24335;&#21644;&#23450;&#20041;</a></td></tr><tr><td align="right">5&nbsp;</td><td><a href="define-struct.html" class="tocviewlink" data-pltdoc="x">&#31243;&#24207;&#21592;&#23450;&#20041;&#30340;&#25968;&#25454;&#31867;&#22411;</a></td></tr><tr><td align="right">6&nbsp;</td><td><a href="modules.html" class="tocviewlink" data-pltdoc="x">&#27169;&#22359;</a></td></tr><tr><td align="right">7&nbsp;</td><td><a href="contracts.html" class="tocviewlink" data-pltdoc="x">&#21512;&#32422;</a></td></tr><tr><td align="right">8&nbsp;</td><td><a href="i_o.html" class="tocviewlink" data-pltdoc="x">&#36755;&#20837;&#21644;&#36755;&#20986;</a></td></tr><tr><td align="right">9&nbsp;</td><td><a href="regexp.html" class="tocviewlink" data-pltdoc="x">&#27491;&#21017;&#34920;&#36798;&#24335;</a></td></tr><tr><td align="right">10&nbsp;</td><td><a href="control.html" class="tocviewlink" data-pltdoc="x">&#24322;&#24120;&#19982;&#25511;&#21046;</a></td></tr><tr><td align="right">11&nbsp;</td><td><a href="for.html" class="tocviewlink" data-pltdoc="x">&#36845;&#20195;&#21644;&#25512;&#23548;</a></td></tr><tr><td align="right">12&nbsp;</td><td><a href="match.html" class="tocviewlink" data-pltdoc="x">&#27169;&#24335;&#21305;&#37197;</a></td></tr><tr><td align="right">13&nbsp;</td><td><a href="classes.html" class="tocviewlink" data-pltdoc="x">&#31867;&#21644;&#23545;&#35937;</a></td></tr><tr><td align="right">14&nbsp;</td><td><a href="units.html" class="tocviewlink" data-pltdoc="x">&#21333;&#20803;</a></td></tr><tr><td align="right">15&nbsp;</td><td><a href="reflection.html" class="tocviewlink" data-pltdoc="x">&#21453;&#23556;&#21644;&#21160;&#24577;&#27714;&#20540;</a></td></tr><tr><td align="right">16&nbsp;</td><td><a href="macros.html" class="tocviewselflink" data-pltdoc="x">&#23439;</a></td></tr><tr><td align="right">17&nbsp;</td><td><a href="languages.html" class="tocviewlink" data-pltdoc="x">&#21019;&#36896;&#35821;&#35328;</a></td></tr><tr><td align="right">18&nbsp;</td><td><a href="concurrency.html" class="tocviewlink" data-pltdoc="x">&#24182;&#21457;&#19982;&#21516;&#27493;</a></td></tr><tr><td align="right">19&nbsp;</td><td><a href="performance.html" class="tocviewlink" data-pltdoc="x">&#24615;&#33021;</a></td></tr><tr><td align="right">20&nbsp;</td><td><a href="parallelism.html" class="tocviewlink" data-pltdoc="x">&#24182;&#34892;</a></td></tr><tr><td align="right">21&nbsp;</td><td><a href="running.html" class="tocviewlink" data-pltdoc="x">&#36816;&#34892;&#21644;&#21019;&#24314;&#21487;&#25191;&#34892;&#31243;&#24207;</a></td></tr><tr><td align="right">22&nbsp;</td><td><a href="More_Libraries.html" class="tocviewlink" data-pltdoc="x">&#26356;&#22810;&#30340;&#24211;</a></td></tr><tr><td align="right">23&nbsp;</td><td><a href="dialects.html" class="tocviewlink" data-pltdoc="x">Racket&#21644;Scheme&#30340;&#26041;&#35328;</a></td></tr><tr><td align="right">24&nbsp;</td><td><a href="other-editors.html" class="tocviewlink" data-pltdoc="x">&#21629;&#20196;&#34892;&#24037;&#20855;&#21644;&#20320;&#30340;&#32534;&#36753;&#22120;&#36873;&#25321;</a></td></tr><tr><td align="right"></td><td><a href="doc-bibliography.html" class="tocviewlink" data-pltdoc="x">Bibliography</a></td></tr><tr><td align="right"></td><td><a href="doc-index.html" class="tocviewlink" data-pltdoc="x">Index</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,&quot;tocview_1&quot;);">&#9658;</a></td><td>16&nbsp;</td><td><a href="macros.html" class="tocviewlink" data-pltdoc="x">&#23439;</a></td></tr></table><div class="tocviewsublist" style="display: none;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">16.1&nbsp;</td><td><a href="pattern-macros.html" class="tocviewlink" data-pltdoc="x">&#22522;&#20110;&#27169;&#24335;&#30340;&#23439;</a></td></tr><tr><td align="right">16.2&nbsp;</td><td><a href="proc-macros.html" class="tocviewselflink" data-pltdoc="x">&#36890;&#29992;&#23439;&#36716;&#21270;&#22120;</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,&quot;tocview_2&quot;);">&#9660;</a></td><td>16.2&nbsp;</td><td><a href="proc-macros.html" class="tocviewlink" data-pltdoc="x">&#36890;&#29992;&#23439;&#36716;&#21270;&#22120;</a></td></tr></table><div class="tocviewsublistbottom" style="display: block;" id="tocview_2"><table cellspacing="0" cellpadding="0"><tr><td align="right">16.2.1&nbsp;</td><td><a href="stx-obj.html" class="tocviewlink" data-pltdoc="x">&#35821;&#27861;&#23545;&#35937;</a></td></tr><tr><td align="right">16.2.2&nbsp;</td><td><a href="macro-transformers.html" class="tocviewlink" data-pltdoc="x">&#23439;&#36716;&#21270;&#22120;&#31243;&#24207;</a></td></tr><tr><td align="right">16.2.3&nbsp;</td><td><a href="syntax-case.html" class="tocviewlink" data-pltdoc="x">&#28151;&#21512;&#27169;&#24335;&#21644;&#34920;&#36798;&#24335;&#65306;<span class="RktSym"><span class="badlink"><span class="RktValLink">syntax-<wbr></wbr>case</span></span></span></a></td></tr><tr><td align="right">16.2.4&nbsp;</td><td><a href="with-syntax.html" class="tocviewlink" data-pltdoc="x"><span class="RktSym"><span class="badlink"><span class="RktValLink">with-<wbr></wbr>syntax</span></span></span>&#21644;<span class="RktSym"><span class="badlink"><span class="RktValLink">generate-<wbr></wbr>temporaries</span></span></span></a></td></tr><tr><td align="right">16.2.5&nbsp;</td><td><a href="" class="tocviewselflink" data-pltdoc="x">&#32534;&#35793;&#21644;&#36816;&#34892;&#26102;&#38454;&#27573;</a></td></tr><tr><td align="right">16.2.6&nbsp;</td><td><a href="phases.html" class="tocviewlink" data-pltdoc="x">&#36890;&#29992;&#38454;&#27573;&#31561;&#32423;</a></td></tr><tr><td align="right">16.2.7&nbsp;</td><td><a href="stx-certs.html" class="tocviewlink" data-pltdoc="x">&#35821;&#27861;&#27745;&#26579;</a></td></tr></table></div></div></div></div><div class="maincolumn"><div class="main"><div class="navsettop"><span class="navleft"><div class="nosearchform"></div>&nbsp;&nbsp;</span><span class="navright">&nbsp;&nbsp;<a href="with-syntax.html" title="backward to &quot;16.2.4 with-syntax和generate-temporaries&quot;" data-pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="proc-macros.html" title="up to &quot;16.2 通用宏转化器&quot;" data-pltdoc="x">up</a>&nbsp;&nbsp;<a href="phases.html" title="forward to &quot;16.2.6 通用阶段等级&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div><h5>16.2.5<tt>&nbsp;</tt><a name="(part._stx-phases)"></a>&#32534;&#35793;&#21644;&#36816;&#34892;&#26102;&#38454;&#27573;</h5><p>&#38543;&#30528;&#23439;&#38598;&#21512;&#36234;&#26469;&#36234;&#22810;&#22797;&#26434;&#65292;&#20320;&#21487;&#33021;&#35201;&#20889;&#20320;&#33258;&#24049;&#30340;&#36741;&#21161;&#20989;&#25968;&#65292;&#22914;<span class="RktSym"><span class="badlink"><span class="RktValLink">generate-temporaries</span></span></span>&#12290;&#20363;&#22914;&#65292;&#25552;&#20379;&#33391;&#22909;&#30340;&#35821;&#27861;&#38169;&#35823;&#20449;&#24687;&#65292;<span class="RktSym">swap</span>&#12289;<span class="RktSym">rotate</span>&#21644;<span class="RktSym">define-cbr</span>&#37117;&#24212;&#35813;&#26816;&#26597;&#22312;&#28304;&#34920;&#20013;&#30340;&#26576;&#19968;&#20010;&#23376;&#34920;&#26159;&#26631;&#35782;&#31526;&#12290;&#25105;&#20204;&#21487;&#20197;&#20351;&#29992;<span class="RktSym">check-ids</span>&#20989;&#25968;&#22312;&#20219;&#20309;&#22320;&#26041;&#25191;&#34892;&#27492;&#26816;&#26597;&#65306;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define-syntax</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">swap</span><span class="hspace">&nbsp;</span><span class="RktSym">stx</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">syntax-case</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">stx</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym">swap</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">begin</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">check-ids</span><span class="hspace">&nbsp;</span><span class="RktSym">stx</span><span class="hspace">&nbsp;</span><span class="RktRdr">#'</span><span class="RktPn">(</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktRdr">#'</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">tmp</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">set!</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">set!</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="hspace">&nbsp;</span><span class="RktSym">tmp</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define-syntax</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">rotate</span><span class="hspace">&nbsp;</span><span class="RktSym">stx</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">syntax-case</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">stx</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym">rotate</span><span class="hspace">&nbsp;</span><span class="RktSym">a</span><span class="hspace">&nbsp;</span><span class="RktSym">c</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">...</span></span></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">begin</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">check-ids</span><span class="hspace">&nbsp;</span><span class="RktSym">stx</span><span class="hspace">&nbsp;</span><span class="RktRdr">#'</span><span class="RktPn">(</span><span class="RktSym">a</span><span class="hspace">&nbsp;</span><span class="RktSym">c</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">...</span></span></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktRdr">#'</span><span class="RktPn">(</span><span class="RktSym">shift-to</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">c</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">...</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">a</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">a</span><span class="hspace">&nbsp;</span><span class="RktSym">c</span><span class="hspace">&nbsp;</span><span class="RktSym"><span class="badlink"><span class="RktValLink">...</span></span></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p><span class="RktSym">check-ids</span>&#20989;&#25968;&#21487;&#20197;&#20351;&#29992;<span class="RktSym"><span class="badlink"><span class="RktValLink">syntax-&gt;list</span></span></span>&#20989;&#25968;&#23558;&#19968;&#20010;&#35821;&#27861;&#23545;&#35937;&#36716;&#25442;&#25104;&#19968;&#20010;&#35821;&#27861;&#23545;&#35937;&#21015;&#34920;&#65306;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">check-ids</span><span class="hspace">&nbsp;</span><span class="RktSym">stx</span><span class="hspace">&nbsp;</span><span class="RktSym">forms</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">for-each</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">lambda</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">form</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">unless</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">identifier?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">form</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">raise-syntax-error</span></span></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">"not an identifier"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">stx</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">form</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">syntax-&gt;list</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">forms</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p>&#28982;&#32780;&#65292;&#22914;&#26524;&#20197;&#36825;&#31181;&#26041;&#24335;&#23450;&#20041;<span class="RktSym">swap</span>&#21644;<span class="RktSym">check-ids</span>&#65292;&#21017;&#23427;&#19981;&#20250;&#36816;&#34892;&#65306;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">a</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span class="RktPn">[</span><span class="RktSym">b</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">swap</span><span class="hspace">&nbsp;</span><span class="RktSym">a</span><span class="hspace">&nbsp;</span><span class="RktSym">b</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktErr">check-ids: undefined;</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;</span><span class="RktErr">cannot reference undefined identifier</span></p></td></tr></table></blockquote><p>&#38382;&#39064;&#26159;<span class="RktSym">check-ids</span>&#34987;&#23450;&#20041;&#20026;&#19968;&#20010;&#36816;&#34892;&#26102;&#34920;&#36798;&#24335;&#65292;&#20294;&#26159;<span class="RktSym">swap</span>&#35797;&#22270;&#22312;&#32534;&#35793;&#26102;&#20351;&#29992;&#23427;&#12290;&#22312;&#20132;&#20114;&#27169;&#24335;&#20013;&#65292;&#32534;&#35793;&#26102;&#21644;&#36816;&#34892;&#26102;&#26159;&#20132;&#38169;&#30340;&#65292;&#20294;&#23427;&#20204;&#19981;&#26159;&#22312;&#27169;&#22359;&#30340;&#20027;&#20307;&#20869;&#20132;&#38169;&#30340;&#65292;&#23427;&#20204;&#19981;&#22312;&#39044;&#32534;&#35793;&#30340;&#27169;&#22359;&#20043;&#38388;&#36827;&#34892;&#20132;&#21449;&#12290;&#20026;&#20102;&#24110;&#21161;&#25152;&#26377;&#36825;&#20123;&#27169;&#24335;&#19968;&#33268;&#22320;&#23545;&#24453;&#20195;&#30721;&#65292;Racket&#23558;&#19981;&#21516;&#38454;&#27573;&#30340;&#32465;&#23450;&#31354;&#38388;&#20998;&#38548;&#24320;&#26469;&#12290;</p><p>&#35201;&#23450;&#20041;&#21487;&#22312;&#32534;&#35793;&#26102;&#24341;&#29992;&#30340;<span class="RktSym">check-ids</span>&#20989;&#25968;&#65292;&#20351;&#29992;<span class="RktSym"><span class="badlink"><span class="RktValLink">begin-for-syntax</span></span></span>&#65306;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">begin-for-syntax</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">check-ids</span><span class="hspace">&nbsp;</span><span class="RktSym">stx</span><span class="hspace">&nbsp;</span><span class="RktSym">forms</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">for-each</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">lambda</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">form</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">unless</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">identifier?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">form</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">raise-syntax-error</span></span></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">"not an identifier"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">stx</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">form</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">syntax-&gt;list</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">forms</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p>&#20351;&#29992;&#27492;&#35821;&#27861;&#23450;&#20041;&#65292;&#37027;&#20040;<span class="RktSym">swap</span>&#23601;&#20250;&#36816;&#34892;&#65306;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">a</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">]</span><span class="hspace">&nbsp;</span><span class="RktPn">[</span><span class="RktSym">b</span><span class="hspace">&nbsp;</span><span class="RktVal">2</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">swap</span><span class="hspace">&nbsp;</span><span class="RktSym">a</span><span class="hspace">&nbsp;</span><span class="RktSym">b</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">list</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">a</span><span class="hspace">&nbsp;</span><span class="RktSym">b</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(2 1)</span></p></td></tr><tr><td><span class="stt">&gt; </span><span class="RktPn">(</span><span class="RktSym">swap</span><span class="hspace">&nbsp;</span><span class="RktSym">a</span><span class="hspace">&nbsp;</span><span class="RktVal">1</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktErr">eval:13:0: swap: not an identifier</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">at: 1</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktErr">in: (swap a 1)</span></p></td></tr></table></blockquote><p>&#24403;&#23558;&#31243;&#24207;&#32452;&#32455;&#25104;&#27169;&#22359;&#26102;&#65292;&#20320;&#20063;&#35768;&#24076;&#26395;&#23558;&#36741;&#21161;&#20989;&#25968;&#25918;&#22312;&#19968;&#20010;&#27169;&#22359;&#20013;&#65292;&#20197;&#20379;&#39547;&#30041;&#22312;&#20854;&#23427;&#27169;&#22359;&#19978;&#30340;&#23439;&#20351;&#29992;&#12290;&#22312;&#36825;&#31181;&#24773;&#20917;&#19979;&#65292;&#20320;&#21487;&#20197;&#20351;&#29992;<span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span>&#32534;&#20889;&#36741;&#21161;&#20989;&#25968;&#65306;</p><blockquote class="SCodeFlow"><blockquote class="Rfilebox"><p class="Rfiletitle"><span class="Rfilename"><span class="stt">"utils.rkt"</span></span></p><blockquote class="Rfilecontent"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><font class="badlink"><span class="RktModLink"><span class="RktMod">#lang</span></span></font><span class="hspace">&nbsp;</span><font class="badlink"><span class="RktModLink"><span class="RktSym">racket</span></span></font></td></tr><tr><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">provide</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">check-ids</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">check-ids</span><span class="hspace">&nbsp;</span><span class="RktSym">stx</span><span class="hspace">&nbsp;</span><span class="RktSym">forms</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">for-each</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">lambda</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">form</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">unless</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">identifier?</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">form</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">raise-syntax-error</span></span></span><span class="hspace">&nbsp;</span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktVal">"not an identifier"</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">stx</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktSym">form</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">syntax-&gt;list</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">forms</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></blockquote></blockquote><p>&#28982;&#21518;&#65292;&#22312;&#23454;&#29616;&#23439;&#27169;&#22359;&#20013;&#65292;&#20351;&#29992;<span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">require</span></span></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">for-syntax</span></span></span><span class="stt"> </span><span class="RktVal">"utils.rkt"</span><span class="RktPn">)</span><span class="RktPn">)</span>&#20195;&#26367;<span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">require</span></span></span><span class="stt"> </span><span class="RktVal">"utils.rkt"</span><span class="RktPn">)</span>&#23548;&#20837;&#36741;&#21161;&#20989;&#25968;&#65306;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><font class="badlink"><span class="RktModLink"><span class="RktMod">#lang</span></span></font><span class="hspace">&nbsp;</span><font class="badlink"><span class="RktModLink"><span class="RktSym">racket</span></span></font></td></tr><tr><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">require</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">for-syntax</span></span></span><span class="hspace">&nbsp;</span><span class="RktVal">"utils.rkt"</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;</span></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define-syntax</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym">swap</span><span class="hspace">&nbsp;</span><span class="RktSym">stx</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">syntax-case</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">stx</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym">swap</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="RktPn">)</span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">begin</span></span></span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym">check-ids</span><span class="hspace">&nbsp;</span><span class="RktSym">stx</span><span class="hspace">&nbsp;</span><span class="RktRdr">#'</span><span class="RktPn">(</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktRdr">#'</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span><span class="hspace">&nbsp;</span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">tmp</span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="RktPn">]</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">set!</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">x</span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">set!</span></span></span><span class="hspace">&nbsp;</span><span class="RktSym">y</span><span class="hspace">&nbsp;</span><span class="RktSym">tmp</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote><p>&#22240;&#20026;&#27169;&#22359;&#20998;&#21035;&#32534;&#35793;&#24182;&#27809;&#26377;&#24490;&#29615;&#20381;&#36182;&#65292;<span class="stt">"utils.rkt"</span>&#27169;&#22359;&#30340;&#36816;&#34892;&#26102;&#26412;&#20307;&#21487;&#20197;&#22312;&#32534;&#35793;&#30340;&#27169;&#22359;&#23454;&#29616;<span class="RktSym">swap</span>&#32534;&#35793;&#12290;&#22240;&#27492;&#65292;&#22312;<span class="stt">"utils.rkt"</span>&#21487;&#20197;&#29992;&#26469;&#23454;&#29616;<span class="RktSym">swap</span>&#65292;&#21482;&#35201;&#20182;&#20204;&#36890;&#36807;<span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">require</span></span></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">for-syntax</span></span></span><span class="stt"> </span><span class="RktSym">....</span><span class="RktPn">)</span><span class="RktPn">)</span>&#26126;&#30830;&#36716;&#31227;&#21040;&#32534;&#35793;&#26102;&#38388;&#12290;</p><p><font class="badlink"><span class="RktModLink"><span class="RktSym">racket</span></span></font>&#27169;&#22359;&#25552;&#20379;&#20102;<span class="RktSym"><span class="badlink"><span class="RktValLink">syntax-case</span></span></span>&#12289;<span class="RktSym"><span class="badlink"><span class="RktValLink">generate-temporaries</span></span></span>&#12289;<span class="RktSym"><span class="badlink"><span class="RktValLink">lambda</span></span></span>&#12289;<span class="RktSym"><span class="badlink"><span class="RktValLink">if</span></span></span>&#20197;&#21450;&#26356;&#22810;&#20197;&#29992;&#22312;&#36816;&#34892;&#26102;&#38454;&#27573;&#21644;&#32534;&#35793;&#26102;&#38454;&#27573;&#12290;&#36825;&#23601;&#26159;&#20026;&#20160;&#20040;&#25105;&#20204;&#26082;&#21487;&#20197;&#30452;&#25509;&#22312;<span class="stt">racket</span>&#30340;<a href="intro.html#%28tech._repl%29" class="techoutside" data-pltdoc="x"><span class="techinside">REPL</span></a>&#20013;&#20063;&#21487;&#20197;&#22312;&#19968;&#20010;<span class="RktSym"><span class="badlink"><span class="RktValLink">define-syntax</span></span></span>&#34920;&#30340;&#21491;&#31471;&#20351;&#29992;<span class="RktSym"><span class="badlink"><span class="RktValLink">syntax-case</span></span></span>&#30340;&#21407;&#22240;&#12290;</p><p>&#19982;&#27492;&#30456;&#21453;&#65292;<font class="badlink"><span class="RktModLink"><span class="RktSym">racket/base</span></span></font>&#27169;&#22359;&#21482;&#22312;&#36816;&#34892;&#26102;&#38454;&#27573;&#23548;&#20986;&#36825;&#20123;&#32465;&#23450;&#12290;&#22914;&#26524;&#20320;&#25913;&#21464;&#19978;&#38754;&#23450;&#20041;<span class="RktSym">swap</span>&#30340;&#27169;&#22359;&#65292;&#20351;&#23427;&#20351;&#29992;<font class="badlink"><span class="RktModLink"><span class="RktSym">racket/base</span></span></font>&#35821;&#35328;&#65292;&#32780;&#19981;&#26159;<font class="badlink"><span class="RktModLink"><span class="RktSym">racket</span></span></font>&#65292;&#37027;&#20040;&#23427;&#19981;&#20877;&#36816;&#34892;&#12290;&#28155;&#21152;<span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">require</span></span></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">for-syntax</span></span></span><span class="stt"> </span><span class="RktSym">racket/base</span><span class="RktPn">)</span><span class="RktPn">)</span>&#23548;&#20837;<span class="RktSym"><span class="badlink"><span class="RktValLink">syntax-case</span></span></span>&#21644;&#26356;&#22810;&#36827;&#20837;&#32534;&#35793;&#26102;&#38454;&#27573;&#65292;&#20351;&#27169;&#22359;&#20877;&#27425;&#24037;&#20316;&#12290;</p><p>&#20551;&#35774;<span class="RktSym"><span class="badlink"><span class="RktValLink">define-syntax</span></span></span>&#29992;&#20110;&#22312;<span class="RktSym"><span class="badlink"><span class="RktValLink">define-syntax</span></span></span>&#34920;&#30340;&#21491;&#31471;&#23450;&#20041;&#19968;&#20010;&#23616;&#37096;&#23439;&#12290;&#22312;&#36825;&#31181;&#24773;&#20917;&#19979;&#65292;&#20869;&#37096;<span class="RktSym"><span class="badlink"><span class="RktValLink">define-syntax</span></span></span>&#30340;&#21491;&#31471;&#20301;&#20110;<a name="(tech._~e5~85~83~e7~bc~96~e8~af~91~e9~98~b6~e6~ae~b5~e7~ad~89~e7~ba~a7~ef~bc~88meta._compile._phase._level~ef~bc~89)"></a><span style="font-style: italic">&#20803;&#32534;&#35793;&#38454;&#27573;&#31561;&#32423;&#65288;meta-compile phase level&#65289;</span>&#65292;&#20063;&#31216;&#20026;<a name="(tech._~e9~98~b6~e6~ae~b5~e7~ad~89~e7~ba~a72~ef~bc~88phase._level._2~ef~bc~89)"></a><span style="font-style: italic">&#38454;&#27573;&#31561;&#32423;2&#65288;phase level 2&#65289;</span>&#12290;&#35201;&#23558;<span class="RktSym"><span class="badlink"><span class="RktValLink">syntax-case</span></span></span>&#23548;&#20837;&#21040;&#35813;&#38454;&#27573;&#31561;&#32423;&#65292;&#20320;&#24517;&#39035;&#20351;&#29992;<span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">require</span></span></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">for-syntax</span></span></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">for-syntax</span></span></span><span class="stt"> </span><span class="RktSym">racket/base</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span>&#65292;&#25110;&#32773;&#31561;&#25928;&#22320;&#20351;&#29992;<span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">require</span></span></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">for-meta</span></span></span><span class="stt"> </span><span class="RktVal">2</span><span class="stt"> </span><span class="RktSym">racket/base</span><span class="RktPn">)</span><span class="RktPn">)</span>&#12290;&#20363;&#22914;,</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><font class="badlink"><span class="RktModLink"><span class="RktMod">#lang</span></span></font><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><font class="badlink"><span class="RktModLink"><span class="RktSym">racket/base</span></span></font><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">require</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktCmt">;;</span><span class="hspace">&nbsp;</span><span class="RktCmt">This</span><span class="hspace">&nbsp;</span><span class="RktCmt">provides</span><span class="hspace">&nbsp;</span><span class="RktCmt">the</span><span class="hspace">&nbsp;</span><span class="RktCmt">bindings</span><span class="hspace">&nbsp;</span><span class="RktCmt">for</span><span class="hspace">&nbsp;</span><span class="RktCmt">the</span><span class="hspace">&nbsp;</span><span class="RktCmt">definition</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktCmt">;;</span><span class="hspace">&nbsp;</span><span class="RktCmt">of</span><span class="hspace">&nbsp;</span><span class="RktCmt">shell-game.</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">for-syntax</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">racket/base</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta">&#160;</span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktCmt">;;</span><span class="hspace">&nbsp;</span><span class="RktCmt">And</span><span class="hspace">&nbsp;</span><span class="RktCmt">this</span><span class="hspace">&nbsp;</span><span class="RktCmt">for</span><span class="hspace">&nbsp;</span><span class="RktCmt">the</span><span class="hspace">&nbsp;</span><span class="RktCmt">definition</span><span class="hspace">&nbsp;</span><span class="RktCmt">of</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktCmt">;;</span><span class="hspace">&nbsp;</span><span class="RktCmt">swap.</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">for-syntax</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">for-syntax</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">racket/base</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta">&#160;</span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define-syntax</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">shell-game</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">stx</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta">&#160;</span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define-syntax</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">swap</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">stx</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">syntax-case</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">stx</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">_</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">a</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">b</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#'</span></span></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">tmp</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">a</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">set!</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">a</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">b</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">set!</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">b</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">tmp</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta">&#160;</span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">syntax-case</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">stx</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">_</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">a</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">b</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">c</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">a</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#'</span></span></span><span class="RktSym">a</span><span class="RktPn">]</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">[</span><span class="RktSym">b</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#'</span></span></span><span class="RktSym">b</span><span class="RktPn">]</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">[</span><span class="RktSym">c</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#'</span></span></span><span class="RktSym">c</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">when</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">=</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktVal">0</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">random</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktVal">2</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">swap</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">a</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">b</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">when</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">=</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktVal">0</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">random</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktVal">2</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">swap</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">b</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">c</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">when</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">=</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktVal">0</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">random</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktVal">2</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">swap</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">a</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">c</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#`</span></span></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">list</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#,</span></span></span><span class="RktSym">a</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#,</span></span></span><span class="RktSym">b</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#,</span></span></span><span class="RktSym">c</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta">&#160;</span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">shell-game</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktVal">3</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktVal">4</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktVal">5</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">shell-game</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktVal">3</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktVal">4</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktVal">5</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">shell-game</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktVal">3</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktVal">4</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktVal">5</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr></table></blockquote><p>&#21453;&#21521;&#38454;&#27573;&#31561;&#32423;&#20063;&#23384;&#22312;&#12290;&#22914;&#26524;&#19968;&#20010;&#23439;&#20351;&#29992;&#20102;&#19968;&#20010;&#23548;&#20837;<span class="RktSym"><span class="badlink"><span class="RktValLink">for-syntax</span></span></span>&#30340;&#36741;&#21161;&#20989;&#25968;&#65292;&#22914;&#26524;&#36741;&#21161;&#20989;&#25968;&#36820;&#22238;&#30001;<span class="RktSym"><span class="badlink"><span class="RktValLink">syntax</span></span></span>&#29983;&#25104;&#30340;&#35821;&#27861;&#23545;&#35937;&#24120;&#37327;&#65292;&#37027;&#20040;&#35821;&#27861;&#20013;&#30340;&#26631;&#35782;&#31526;&#23558;&#38656;&#35201;&#22312;<a name="(tech._~e9~98~b6~e6~ae~b5~e7~ad~89~e7~ba~a7._1~ef~bc~88phase._level._1~ef~bc~89)"></a><span style="font-style: italic">&#38454;&#27573;&#31561;&#32423;-1&#65288;phase level -1&#65289;</span>&#65292;&#20063;&#31216;&#20026;<a name="(tech._~e6~a8~a1~e6~9d~bf~e9~98~b6~e6~ae~b5~e7~ad~89~e7~ba~a7~ef~bc~88template._phase._level~ef~bc~89)"></a><span style="font-style: italic">&#27169;&#26495;&#38454;&#27573;&#31561;&#32423;&#65288;template phase level&#65289;</span>&#65292;&#20197;&#20415;&#22312;&#36816;&#34892;&#26102;&#38454;&#27573;&#31561;&#32423;&#30456;&#23545;&#20110;&#23450;&#20041;&#23439;&#30340;&#27169;&#22359;&#26377;&#20219;&#20309;&#32465;&#23450;&#12290;</p><p>&#20363;&#22914;&#65292;&#22312;&#19979;&#38754;&#30340;&#20363;&#23376;&#20013;&#27809;&#26377;&#35821;&#27861;&#21464;&#25442;&#22120;&#30340;<span class="RktSym">swap-stx</span>&#30340;&#36741;&#21161;&#20989;&#25968;&#8212;&#8212;&#23427;&#21482;&#26159;&#19968;&#20010;&#26222;&#36890;&#30340;&#20989;&#25968;&#8212;&#8212;&#20294;&#23427;&#20135;&#29983;&#30340;&#35821;&#27861;&#23545;&#35937;&#24471;&#21040;&#25340;&#25509;&#25104;<span class="RktSym">shell-game</span>&#30340;&#32467;&#26524;&#12290;&#22240;&#27492;&#65292;&#20854;&#21253;&#21547;&#30340;&#36741;&#21161;&#27169;&#22359;&#38656;&#35201;&#22312;<span class="RktSym">shell-game</span>&#38454;&#27573;1&#29992;<span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">require</span></span></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">for-syntax</span></span></span><span class="stt"> </span><span class="RktVal">'</span><span class="RktVal">helper</span><span class="RktPn">)</span><span class="RktPn">)</span>&#23548;&#20837;&#12290;</p><p>&#20294;&#20174;<span class="RktSym">swap-stx</span>&#30340;&#35282;&#24230;&#65292;&#24403;&#34987;<span class="RktSym">shell-game</span>&#36820;&#22238;&#30340;&#35821;&#27861;&#27714;&#20540;&#26102;&#65292;&#20854;&#32467;&#26524;&#26368;&#32456;&#22312;&#38454;&#27573;1&#27714;&#20540;&#12290;&#25442;&#21477;&#35805;&#35828;&#65292;&#19968;&#20010;&#36127;&#21521;&#38454;&#27573;&#31561;&#32423;&#26159;&#19968;&#20010;&#20174;&#27491;&#26041;&#21521;&#26469;&#30475;&#30340;&#30456;&#21453;&#30340;&#26041;&#38454;&#27573;&#31561;&#32423;&#65306;<span class="RktSym">shell-game</span>&#30340;&#38454;&#27573;1&#26159;<span class="RktSym">swap-stx</span>&#30340;&#38454;&#27573;0&#65292;&#25152;&#20197;<span class="RktSym">shell-game</span>&#30340;&#38454;&#27573;0&#26159;<span class="RktSym">swap-stx</span>&#30340;&#38454;&#27573;-1&#12290;&#36825;&#23601;&#26159;&#20026;&#20160;&#20040;&#36825;&#20010;&#20363;&#23376;&#19981;&#36816;&#34892;&#8212;&#8212;<span class="RktVal">'</span><span class="RktVal">helper</span>&#23376;&#27169;&#22359;&#22312;&#38454;&#27573;-1&#27809;&#26377;&#32465;&#23450;&#12290;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><font class="badlink"><span class="RktModLink"><span class="RktMod">#lang</span></span></font><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><font class="badlink"><span class="RktModLink"><span class="RktSym">racket/base</span></span></font><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">require</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">for-syntax</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">racket/base</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta">&#160;</span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">module</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">helper</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">racket/base</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">provide</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">swap-stx</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">swap-stx</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">a-stx</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">b-stx</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#`</span></span></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">tmp</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#,</span></span></span><span class="RktSym">a-stx</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">set!</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#,</span></span></span><span class="RktSym">a-stx</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#,</span></span></span><span class="RktSym">b-stx</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">set!</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#,</span></span></span><span class="RktSym">b-stx</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">tmp</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta">&#160;</span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">require</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">for-syntax</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">'</span></span></span><span class="RktSym">helper</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta">&#160;</span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define-syntax</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">shell-game</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">stx</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">syntax-case</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">stx</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">_</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">a</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">b</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">c</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#`</span></span></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">begin</span></span></span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#,</span></span></span><span class="RktPn">(</span><span class="RktSym">swap-stx</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#'</span></span></span><span class="RktSym">a</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#'</span></span></span><span class="RktSym">b</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#,</span></span></span><span class="RktPn">(</span><span class="RktSym">swap-stx</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#'</span></span></span><span class="RktSym">b</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#'</span></span></span><span class="RktSym">c</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#,</span></span></span><span class="RktPn">(</span><span class="RktSym">swap-stx</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#'</span></span></span><span class="RktSym">a</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#'</span></span></span><span class="RktSym">c</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">list</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">a</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">b</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">c</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta">&#160;</span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktVal">3</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">y</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktVal">4</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">z</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktVal">5</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">shell-game</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">y</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">z</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr></table></blockquote><p>&#20462;&#22797;&#36825;&#20010;&#20363;&#23376;&#65292;&#25105;&#20204;&#28155;&#21152;<span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">require</span></span></span><span class="stt"> </span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">for-template</span></span></span><span class="stt"> </span><span class="RktSym">racket/base</span><span class="RktPn">)</span><span class="RktPn">)</span>&#21040;<span class="RktVal">'</span><span class="RktVal">helper</span>&#23376;&#27169;&#22359;&#12290;</p><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><font class="badlink"><span class="RktModLink"><span class="RktMod">#lang</span></span></font><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><font class="badlink"><span class="RktModLink"><span class="RktSym">racket/base</span></span></font><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">require</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">for-syntax</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">racket/base</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta">&#160;</span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">module</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">helper</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">racket/base</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">require</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">for-template</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">racket/base</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktCmt">;</span><span class="hspace">&nbsp;</span><span class="RktCmt">binds</span><span class="hspace">&nbsp;</span><span class="RktCmt">`let`</span><span class="hspace">&nbsp;</span><span class="RktCmt">and</span><span class="hspace">&nbsp;</span><span class="RktCmt">`set!`</span><span class="hspace">&nbsp;</span><span class="RktCmt">at</span><span class="hspace">&nbsp;</span><span class="RktCmt">phase</span><span class="hspace">&nbsp;</span><span class="RktCmt">-1</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">provide</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">swap-stx</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">swap-stx</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">a-stx</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">b-stx</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#`</span></span></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">let</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktPn">[</span><span class="RktSym">tmp</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#,</span></span></span><span class="RktSym">a-stx</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">set!</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#,</span></span></span><span class="RktSym">a-stx</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#,</span></span></span><span class="RktSym">b-stx</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">set!</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#,</span></span></span><span class="RktSym">b-stx</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">tmp</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta">&#160;</span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">require</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">for-syntax</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">'</span></span></span><span class="RktSym">helper</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta">&#160;</span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define-syntax</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">shell-game</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">stx</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">syntax-case</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">stx</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">_</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">a</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">b</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">c</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#`</span></span></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">begin</span></span></span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#,</span></span></span><span class="RktPn">(</span><span class="RktSym">swap-stx</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#'</span></span></span><span class="RktSym">a</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#'</span></span></span><span class="RktSym">b</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#,</span></span></span><span class="RktPn">(</span><span class="RktSym">swap-stx</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#'</span></span></span><span class="RktSym">b</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#'</span></span></span><span class="RktSym">c</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#,</span></span></span><span class="RktPn">(</span><span class="RktSym">swap-stx</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#'</span></span></span><span class="RktSym">a</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym"><span class="badlink"><span class="RktValLink">#'</span></span></span><span class="RktSym">c</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="hspace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">list</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">a</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">b</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">c</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta">&#160;</span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktVal">3</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">y</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktVal">4</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><span class="badlink"><span class="RktValLink">define</span></span></span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">z</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktVal">5</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">shell-game</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">y</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">z</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">shell-game</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">y</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">z</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr><tr><td><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym">shell-game</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">x</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">y</span><span class="RktMeta"></span><span class="hspace">&nbsp;</span><span class="RktMeta"></span><span class="RktSym">z</span><span class="RktPn">)</span><span class="RktMeta"></span></td></tr></table></blockquote><div class="navsetbottom"><span class="navleft"><div class="nosearchform"></div>&nbsp;&nbsp;</span><span class="navright">&nbsp;&nbsp;<a href="with-syntax.html" title="backward to &quot;16.2.4 with-syntax和generate-temporaries&quot;" data-pltdoc="x">&larr; prev</a>&nbsp;&nbsp;<a href="proc-macros.html" title="up to &quot;16.2 通用宏转化器&quot;" data-pltdoc="x">up</a>&nbsp;&nbsp;<a href="phases.html" title="forward to &quot;16.2.6 通用阶段等级&quot;" data-pltdoc="x">next &rarr;</a></span>&nbsp;</div></div></div><div id="contextindicator">&nbsp;</div></body></html>